import { Injectable } from '@angular/core';

@Injectable()
export class DeleteItemArrayService {

      constructor() { };

      private indexOf(arry, item) {
            for (let i = 0; i < arry.length; i++) {
                  if (arry[i] == item) return i;
            }
            return -1;
      }

      public remove(arry, item) {

            let index = this.indexOf(arry, item);
            if (index > -1) {
                  arry.splice(index, 1);
            }
      }

}
